<html>
<head><meta charset="utf-8"><title>compress-the-cfg (polonius#20) · t-compiler/wg-nll · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/index.html">t-compiler/wg-nll</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html">compress-the-cfg (polonius#20)</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="127201300"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127201300" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127201300">(May 28 2018 at 11:21)</a>:</h4>
<p><span class="user-mention" data-user-id="117910">@Julien Cretin</span> so — the idea there is to compress the points in some way — <span class="user-mention" data-user-id="116609">@Frank McSherry</span> pointed out that we could probably look for edges <code>P -&gt; Q</code> where the set of live regions is the same for both P and Q. That's a good starting point, though I think we'd have to do better.</p>



<a name="127201350"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127201350" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Julien Cretin (ia0) <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127201350">(May 28 2018 at 11:22)</a>:</h4>
<p>Ok, I'll start with that. Should I create a new algorithm or edit an existing one?</p>



<a name="127201353"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127201353" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127201353">(May 28 2018 at 11:22)</a>:</h4>
<p>I thnk that to start you should make a new algorithm "forked" from the naive</p>



<a name="127201357"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127201357" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127201357">(May 28 2018 at 11:22)</a>:</h4>
<p>it's a lot smaller and easier to wrap your head around</p>



<a name="127201358"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127201358" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127201358">(May 28 2018 at 11:22)</a>:</h4>
<p>we can port the concept to the optimized one</p>



<a name="127201361"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127201361" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Julien Cretin (ia0) <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127201361">(May 28 2018 at 11:23)</a>:</h4>
<p>ok</p>



<a name="127201641"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127201641" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Julien Cretin (ia0) <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127201641">(May 28 2018 at 11:30)</a>:</h4>
<p>FYI: My current status is reading the naive algorithm</p>



<a name="127203110"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127203110" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Julien Cretin (ia0) <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127203110">(May 28 2018 at 12:11)</a>:</h4>
<p>Progress checkpoint: We are going to write a function condense_cfg(all_facts: AllFacts&lt;Region, Loan, Point&gt;) -&gt; AllFacts&lt;Region, Loan, Point&gt; that we're going to call before naive::compute.<br>
This function would "merge" successor points into predecessor points according to the criteria defined in polonius#20 (and "fixing" the facts that mention the removed successor point)</p>



<a name="127203251"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127203251" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127203251">(May 28 2018 at 12:15)</a>:</h4>
<p>(Sorry on my phone — I think the exact algo from the issue won’t have much impact on clap; the last criteria has no matches in the dataset IIRC. Compressing is definitely the next big speedup for sure; just FYI wrt these exact rules)</p>



<a name="127204014"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127204014" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127204014">(May 28 2018 at 12:39)</a>:</h4>
<p>(I think 15 out the 60-61 cfg edges from the “issue” dataset have no impact on the result)</p>



<a name="127204399"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127204399" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127204399">(May 28 2018 at 12:49)</a>:</h4>
<p>(I agree the precise criteria in the issue are prob not the right ones; not 100% sure what the right ones are — but experimenting a bit seems good)</p>



<a name="127204745"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127204745" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Julien Cretin (ia0) <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127204745">(May 28 2018 at 12:58)</a>:</h4>
<p>inputs/issue-47680/nll-facts/main has 37 nodes to be merged according to the polonius#20 criteria. I'll experiment on this one. I haven't implemented the merge yet, just the filtering of nodes to be merged.</p>



<a name="127205502"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127205502" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127205502">(May 28 2018 at 13:20)</a>:</h4>
<p>I guess there are two mildly separable concerns — which nodes to merge, and how to adjust the rules to reflect the merging of nodes</p>



<a name="127205512"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127205512" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127205512">(May 28 2018 at 13:21)</a>:</h4>
<p>I think probably two points which have the same live regions can be merged so long as there is no <code>Invalidate</code> at either of them</p>



<a name="127205514"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127205514" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127205514">(May 28 2018 at 13:21)</a>:</h4>
<p>well, sorry, and there is only one outgoing cfg edge from the prior point</p>



<a name="127205515"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127205515" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127205515">(May 28 2018 at 13:21)</a>:</h4>
<p>(basically, points within a basic block)</p>



<a name="127205516"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127205516" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127205516">(May 28 2018 at 13:21)</a>:</h4>
<p>but I might be missing something</p>



<a name="127206376"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127206376" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127206376">(May 28 2018 at 13:44)</a>:</h4>
<p>(A bunch of the Start to Mid edges looked very filterable)</p>



<a name="127206463"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127206463" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127206463">(May 28 2018 at 13:47)</a>:</h4>
<p>yes certainly those; I expect the majority mid-to-start edges can also be filtered</p>



<a name="127206466"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127206466" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127206466">(May 28 2018 at 13:47)</a>:</h4>
<p>but we have to figure out just the right rules I guess, not sure if what I wrote is in fact correct</p>



<a name="127206471"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127206471" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127206471">(May 28 2018 at 13:48)</a>:</h4>
<p>I suppose this might be a case where #19 could help</p>



<a name="127206510"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127206510" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127206510">(May 28 2018 at 13:48)</a>:</h4>
<p>in particular, there are some patterns in the way we generate facts that may not be evident from the current setup I think</p>



<a name="127206512"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127206512" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127206512">(May 28 2018 at 13:48)</a>:</h4>
<p>agreed</p>



<a name="127206516"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127206516" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127206516">(May 28 2018 at 13:48)</a>:</h4>
<p>though I'm trying to think of some concrete examples</p>



<a name="127206529"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127206529" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127206529">(May 28 2018 at 13:48)</a>:</h4>
<p>presuming that the set of live regions at each point is the same....</p>



<a name="127206535"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127206535" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127206535">(May 28 2018 at 13:49)</a>:</h4>
<p>I suppose the danger would be something where you setup half a path in one opint</p>



<a name="127206538"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127206538" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127206538">(May 28 2018 at 13:49)</a>:</h4>
<p>and the other half in the other</p>



<a name="127206539"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127206539" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127206539">(May 28 2018 at 13:49)</a>:</h4>
<p>but they are never connected</p>



<a name="127206551"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127206551" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127206551">(May 28 2018 at 13:49)</a>:</h4>
<p>e.g., say that A and B are live at P and Q (and only A and B), and you have outlives facts like:</p>
<div class="codehilite"><pre><span></span>outlives(A, TMP1, P)
outlives(TMP1, B, Q)
</pre></div>



<a name="127206591"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127206591" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127206591">(May 28 2018 at 13:50)</a>:</h4>
<p>but I .. sort of doubt we ever do that</p>



<a name="127206605"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127206605" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127206605">(May 28 2018 at 13:50)</a>:</h4>
<p>(I guess we could merge points where the regions in outlives relations are disjoint or something, though computing that takes some work)</p>



<a name="127206617"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127206617" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127206617">(May 28 2018 at 13:51)</a>:</h4>
<blockquote>
<p>e.g., say that A and B are live at P and Q (and only A and B), and you have outlives facts like:</p>
</blockquote>
<p>to spool this out a bit more:</p>
<p>If we had this scenario, under the naive rules, we would not find that <code>A: B</code>, because transitioning from A to B that outlives relation would be dropped. But if we merged P and Q, we might, because we would have <code>outlives(A, TMP1</code>) and <code>outlives(TMP1, B)</code> at the same (merged) point.</p>



<a name="127206624"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127206624" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127206624">(May 28 2018 at 13:52)</a>:</h4>
<p>in any case I can imagine various ways to handle that</p>



<a name="127206666"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127206666" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127206666">(May 28 2018 at 13:52)</a>:</h4>
<p>frank has interesting « equiv/InEquiv edges/points » rules I had implemented in a datafrog computation — how to produce the expected borrow_live_at + errors we needed was a bit more complex :)</p>



<a name="127206670"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127206670" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127206670">(May 28 2018 at 13:52)</a>:</h4>
<p>yeah, I should look at those in more depth</p>



<a name="127206682"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127206682" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127206682">(May 28 2018 at 13:53)</a>:</h4>
<p><span class="emoji emoji-1f44d" title="thumbs up">:thumbs_up:</span> (but should also enjoy the holiday ;)</p>



<a name="127206686"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127206686" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127206686">(May 28 2018 at 13:54)</a>:</h4>
<p><span class="user-mention" data-user-id="116113">@lqd</span> can you send a link? :)</p>



<a name="127206745"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127206745" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127206745">(May 28 2018 at 13:55)</a>:</h4>
<p>I can try (phone + subway ;)</p>



<a name="127206886"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127206886" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127206886">(May 28 2018 at 13:59)</a>:</h4>
<p>The mobile app doesnt really havie links but Franks message was : «  E.g. we could put together a relation Equiv(P,Q) which is CFG(P,Q) minus any pairs for which RLA(R,P), !RLA(R,Q) or any Killed(R,P) or Killed(R,Q). » if Search works. He had exact datalog rules  a bit later; I coded them and gisted them on Zulip recently — I’ll now look for them</p>



<a name="127207183"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127207183" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127207183">(May 28 2018 at 14:06)</a>:</h4>
<p><a href="https://gist.github.com/lqd/743abae3913bc3785a955b749289ca03" target="_blank" title="https://gist.github.com/lqd/743abae3913bc3785a955b749289ca03">https://gist.github.com/lqd/743abae3913bc3785a955b749289ca03</a></p>



<a name="127207833"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127207833" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Julien Cretin (ia0) <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127207833">(May 28 2018 at 14:22)</a>:</h4>
<p><a href="https://github.com/ia0/polonius/compare/master...ia0:condense_cfg" target="_blank" title="https://github.com/ia0/polonius/compare/master...ia0:condense_cfg">https://github.com/ia0/polonius/compare/master...ia0:condense_cfg</a>  &lt;=  current implementation, I'll try to look at small examples manually and compare with the naive algorithm</p>



<a name="127208365"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127208365" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Janito Vaqueiro Ferreira Filho <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127208365">(May 28 2018 at 14:34)</a>:</h4>
<p>Hello! Here's my first attempt: <a href="https://github.com/jvff/polonius/compare/master...jvff:condense-cfg" target="_blank" title="https://github.com/jvff/polonius/compare/master...jvff:condense-cfg">https://github.com/jvff/polonius/compare/master...jvff:condense-cfg</a></p>



<a name="127208443"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127208443" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127208443">(May 28 2018 at 14:36)</a>:</h4>
<p><span class="user-mention" data-user-id="117910">@Julien Cretin</span> <span class="user-mention" data-user-id="117912">@Janito Vaqueiro Ferreira Filho</span> (are you two working together or are these competing sets of changes?)</p>



<a name="127208453"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127208453" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Julien Cretin (ia0) <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127208453">(May 28 2018 at 14:36)</a>:</h4>
<p>Those are "competing" set of changes</p>



<a name="127208465"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127208465" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127208465">(May 28 2018 at 14:36)</a>:</h4>
<p>ok</p>



<a name="127208472"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127208472" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127208472">(May 28 2018 at 14:37)</a>:</h4>
<p>seems ok, we can take the "best of both", just wanted to know whether to look at them both</p>



<a name="127208487"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127208487" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Janito Vaqueiro Ferreira Filho <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127208487">(May 28 2018 at 14:37)</a>:</h4>
<p>We're three people doing 3 different implementations, but we're mostly learning about the code and learning with each other</p>



<a name="127209087"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127209087" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> emilsp <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127209087">(May 28 2018 at 14:52)</a>:</h4>
<p>I too am working on a competing solution.  But I'm pretty far behind at this point in time.</p>



<a name="127209618"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127209618" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127209618">(May 28 2018 at 15:04)</a>:</h4>
<p>/me looks at these branches (sorry for delay)</p>



<a name="127209776"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127209776" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127209776">(May 28 2018 at 15:08)</a>:</h4>
<p>ok, so, <span class="user-mention" data-user-id="117910">@Julien Cretin</span>, i'm curious if you got back any stats on how often those changes apply</p>



<a name="127209781"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127209781" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127209781">(May 28 2018 at 15:08)</a>:</h4>
<p>if I understood your branch, I guess it does a kind of "pre-pass" to compress the facts?</p>



<a name="127209806"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127209806" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127209806">(May 28 2018 at 15:09)</a>:</h4>
<p>one thing I like about this approach: if we rework the <code>AllFacts</code> with custom code, we can then feed them into the naive and optimized algorithms and measure the difference in speed — it gives us a kind of "lower bound" on how effective this can be</p>



<a name="127209863"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127209863" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127209863">(May 28 2018 at 15:10)</a>:</h4>
<p>I suspect longer term we would want to code up the compression in <span class="emoji emoji-1f438" title="frog">:frog:</span> or else maybe even do it on the rustc side, not entirely clear, depends on what precise conditions we wind up with (I suspect we may find that some conditions hold sort of "structurally" much of the time and that rustc could enforce them quite cheaply)</p>



<a name="127209939"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127209939" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127209939">(May 28 2018 at 15:12)</a>:</h4>
<p><span class="user-mention" data-user-id="117912">@Janito Vaqueiro Ferreira Filho</span> looking at your branch, which I think is taking a similar approach, similar comments apply — though I am a bit confused by the <code>merge_edge</code> routine, which seems to basically just delete things relating to the <code>second</code> point, right? (not so much "merging" then...)</p>



<a name="127210078"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127210078" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Janito Vaqueiro Ferreira Filho <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127210078">(May 28 2018 at 15:16)</a>:</h4>
<p>Yes, true. It merges the <code>cfg_edge</code> vector though. But the code needs some improvements, and I think tomorrow I'll start playing with the <code>edge_is_mergeable</code> function to see what rules can be applied.</p>



<a name="127210209"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127210209" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Janito Vaqueiro Ferreira Filho <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127210209">(May 28 2018 at 15:18)</a>:</h4>
<p>We're wrapping up for today, but we'll be back here tomorrow</p>



<a name="127210304"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127210304" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127210304">(May 28 2018 at 15:21)</a>:</h4>
<p>great :)</p>



<a name="127210315"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127210315" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127210315">(May 28 2018 at 15:21)</a>:</h4>
<p>I'll try to wake up early tomorrow to overlap with CET as much as possible</p>



<a name="127243010"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127243010" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127243010">(May 29 2018 at 09:37)</a>:</h4>
<p>another data point: 2870 cfg edges out of the 51896 have no impact on the <code>borrow_live_at</code> results of clap, and most of <em>those</em> are goto edges between blocks. (instead of trying to think about the rules I bruteforced the checks while I was away, here are those <a href="https://gist.github.com/lqd/cfdea07f4a6abfb4007919e5ffef347a" target="_blank" title="https://gist.github.com/lqd/cfdea07f4a6abfb4007919e5ffef347a">results</a>) -- I'll check later today whether filtering those 5% out has interesting performance benefits, if anyone doesn't get to it first :) (maybe we can also easily reverse engineer the rules from the data)</p>



<a name="127243414"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127243414" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127243414">(May 29 2018 at 09:51)</a>:</h4>
<p>I have not had time to pursue <a href="https://github.com/rust-lang/rust/pull/50938" target="_blank" title="https://github.com/rust-lang/rust/pull/50938">https://github.com/rust-lang/rust/pull/50938</a> any further, but it seems related. In particular, it removes a lot of "duplicate" outlives relations — strangely, when I tested polonius with it, it seemed to make things go slower. :/ Not sure why that would be yet!</p>



<a name="127243420"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127243420" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127243420">(May 29 2018 at 09:52)</a>:</h4>
<p>that said, we got to land the rustc integration — it was showing some problems with polonius (actually related to #24), in terms of failing tests. This may indicate a problem with the optimized variant.</p>



<a name="127243457"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127243457" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127243457">(May 29 2018 at 09:52)</a>:</h4>
<p>/me goes back to his coffee</p>



<a name="127243559"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127243559" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127243559">(May 29 2018 at 09:54)</a>:</h4>
<p>oh yes I remember we talked about Location:All temporarily creating <code>outlives</code> facts -- the slowdown is interesting indeed. So there are at least 2 directions to investigate, both the <code>outlives</code> and <code>cfg_edge</code> relations</p>



<a name="127243853"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127243853" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127243853">(May 29 2018 at 10:02)</a>:</h4>
<p>I guess a problem located solely in the optimized variant would be surprising, since it has the same output as the naive variant (except if we're talking <code>errors</code> ofc)</p>



<a name="127244356"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127244356" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127244356">(May 29 2018 at 10:19)</a>:</h4>
<blockquote>
<p>I guess a problem located solely in the optimized variant would be surprising, since it has the same output as the naive variant</p>
</blockquote>
<p>on our tests so far :)</p>
<blockquote>
<p>(except if we're talking <code>errors</code> ofc)</p>
</blockquote>
<p>I would expect the result to be the same for <code>errors</code> =)</p>



<a name="127244411"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127244411" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127244411">(May 29 2018 at 10:20)</a>:</h4>
<p>haha yes :)</p>



<a name="127244469"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127244469" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127244469">(May 29 2018 at 10:22)</a>:</h4>
<p>as I mentioned to Felix, it's also why I really wanted to add the frontend to be able to have more diverse tests on our side :) eg these potentially diverging ones that are only in rustc at the moment</p>



<a name="127244523"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127244523" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127244523">(May 29 2018 at 10:24)</a>:</h4>
<p>yes my expectation is that once we have integration going we will add more tests as we find interesting examples</p>



<a name="127244555"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127244555" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127244555">(May 29 2018 at 10:25)</a>:</h4>
<p>(Note: I have no evidence that the problem is the opt diverging from naive, just saying it's possible)</p>



<a name="127244598"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127244598" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127244598">(May 29 2018 at 10:26)</a>:</h4>
<p>anyway, gotta run for a bit — I should add that I've seen these failures before, they are caused by the return type not being properly enforced everywhere...</p>



<a name="127244600"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127244600" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127244600">(May 29 2018 at 10:26)</a>:</h4>
<p>sure :)</p>



<a name="127248928"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127248928" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Julien Cretin (ia0) <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127248928">(May 29 2018 at 12:26)</a>:</h4>
<p>Shouldn't the region_live_at relation be closed under the subset relation? I mean adding the following rule:<br>
region_live_at(R2, P) :- region_live_at(R1, P), subset(R1, R2, P).<br>
Or is this somehow guaranteed in the nll-facts input?</p>



<a name="127249025"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127249025" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127249025">(May 29 2018 at 12:28)</a>:</h4>
<p>that is not necessarily true, no</p>



<a name="127249035"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127249035" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127249035">(May 29 2018 at 12:29)</a>:</h4>
<p>region-live-at implies that a reference whose type includes <em>that region</em> will be used</p>



<a name="127249038"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127249038" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127249038">(May 29 2018 at 12:29)</a>:</h4>
<p>you can think of regions as sets of loans</p>



<a name="127249084"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127249084" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127249084">(May 29 2018 at 12:30)</a>:</h4>
<p>and it is true that loans "flow through" subset in this way</p>



<a name="127249106"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127249106" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127249106">(May 29 2018 at 12:30)</a>:</h4>
<p>(that is, if you have <code>L in R1</code> and <code>R1 &lt;= R2</code> and <code>region_live_at(R2)</code> at a given point, then <code>borrow_live_at(L)</code>)</p>



<a name="127249306"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127249306" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Julien Cretin (ia0) <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127249306">(May 29 2018 at 12:36)</a>:</h4>
<p>Ok I see, thanks!</p>



<a name="127255584"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg%20%28polonius%2320%29/near/127255584" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Julien Cretin (ia0) <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/compress-the-cfg.20(polonius.2320).html#127255584">(May 29 2018 at 14:52)</a>:</h4>
<p># Status<br>
Added a --condense-cfg flag in <a href="https://github.com/ia0/polonius/compare/master...ia0:condense_cfg" target="_blank" title="https://github.com/ia0/polonius/compare/master...ia0:condense_cfg">https://github.com/ia0/polonius/compare/master...ia0:condense_cfg</a>.<br>
Added the example A of the blog in <a href="https://github.com/ia0/polonius/compare/master...ia0:blog_example" target="_blank" title="https://github.com/ia0/polonius/compare/master...ia0:blog_example">https://github.com/ia0/polonius/compare/master...ia0:blog_example</a>.<br>
Print errors for naive algorithm in <a href="https://github.com/ia0/polonius/compare/master...ia0:naive_errors" target="_blank" title="https://github.com/ia0/polonius/compare/master...ia0:naive_errors">https://github.com/ia0/polonius/compare/master...ia0:naive_errors</a>.<br>
# Observations<br>
The set of errors is preserved for inputs/{{blog,issue-47680}/nll-facts/main,clap-rs/app-parser-\{\{impl\}\}-add_defaults}.<br>
Only issue-47680 has merged nodes.<br>
The clap-rs example is slightly slower when condensing the CFG although the facts are equivalent (only the order changes).</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>